/*
 * TcpClientSession.h
 *
 *  Created on: Sep 13, 2012
 *      Author: shawnmao
 */

#ifndef TCPCLIENTSESSION_H_
#define TCPCLIENTSESSION_H_

#include "Common.h"
#include "type.h"

class TcpClientSession
{
public:
	int cli_connect();
	virtual void execute_cli_protocol() = 0;
	void cli_close();

protected:
	TcpClientSession(string local_addr,
					 uint16_t local_port,
					 string remote_addr,
					 uint16_t remote_port);
	virtual ~TcpClientSession();

protected:
	in_addr_t m_local_addr;
	in_addr_t m_local_port;
	struct sockaddr_in m_local_struct_addr;

	in_addr_t m_remote_addr;
	in_port_t m_remote_port;
	struct sockaddr_in m_remote_struct_addr;

	int m_conn_sock;

	TcpSessionState m_tcp_state;
};


#endif /* TCPCLIENTSESSION_H_ */
